// 小仓库：layout组件相关配置仓库
import { defineStore } from 'pinia'

const useLayoutSettingStore = defineStore('SettingStore', {
  state: () => {
    return {
      // 侧边栏菜单是否折叠
      fold: false, // 默认不折叠
      // 页面局部刷新
      refurbish: false, // 默认不刷新
    }
  },
  actions: {
    // 控制侧边栏菜单折叠与展开（来回切换）
    foldToggle() {
      this.fold = !this.fold
    },
    // 改变刷新状态
    refurbishToggle() {
      this.refurbish = !this.refurbish
    },
  },
})

export default useLayoutSettingStore
